package com.xnxkj.wx.micro.mch.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.Date;

/**
 * 平台证书
 */
@Data
public class Certificate {
    /**
     * 证书序列号
     */
    @JsonProperty("serial_no")
    private String serialNo;

    /**
     * 启用时间
     */
    @JsonProperty("effective_time")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date effectiveTime;

    /**
     * 过期时间
     */
    @JsonProperty("expire_time")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date expireTime;

    /**
     * 加密证书内容
     */
    @JsonProperty("encrypt_certificate")
    private EncryptCertificate encryptCertificate;

    /**
     * 加密证书信息
     */
    @Data
    public static class EncryptCertificate{
        private String algorithm;
        private String nonce;
        @JsonProperty("associated_data")
        private String associatedData;
        @JsonProperty("ciphertext")
        private String cipherText;
    }
}
